/*
 * @(#)ListDmsEmailAuditTrailForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;


import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.dms.bean.DmsEmailAuditTrail;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractSearchForm;

/**
  ListDmsEmailAuditTrailForm.java

  This class is the for web form purpose.

  @author      barbin tao
  @company     DCIVision Limited
  @creation date   13/09/2006
  @version     $Revision: 1.2 $
*/

public class ListDmsEmailAuditTrailForm extends AbstractSearchForm {

  public static final String REVISION = "$Revision: 1.2 $";

  private String emailType;
  private String operation;
  private String userid;
  private String emailSubject;
  private String emailFrom;
  private String emailCc;
  private String emailBcc;
  private String emailTo;
  private String sentDate;
  private String secondDate;
  private String attchName;
  private String attchSource;
  private String operationSearchType;
  private String userSearchType;
  private String fromSearchType;
  private String toSearchType;
  private String ccSearchType;
  private String bccSearchType;
  private String sentDateSearchType;
  private String typeSearchType;
  private String attchNameSearchType;
  private String subjectSearchType;
  private String secondDateSearchType;
  private String sentDateValue;
  private String secondDateValue;
  private List  result;
  private String sortAttribute;
  private String sortOrder;

  public ListDmsEmailAuditTrailForm() {
    super();
    this.setSortAttribute("SENT_DATE");
  }

  public String getEmailType() { 
    return(this.emailType);
  }

  public void setEmailType(String emailType) { 
    this.emailType = emailType;
  }

  public String getOperation() { 
    return(this.operation);
  }

  public void setOperation(String operation) { 
    this.operation = operation;
  }

  public String getUserid() { 
    return(this.userid);
  }

  public void setUserid(String userid) { 
    this.userid = userid;
  }

  public String getEmailSubject() { 
    return(this.emailSubject);
  }

  public void setEmailSubject(String emailSubject) { 
    this.emailSubject = emailSubject;
  }

  public String getEmailFrom() { 
    return(this.emailFrom);
  }

  public void setEmailFrom(String emailFrom) { 
    this.emailFrom = emailFrom;
  }

  public String getEmailCc() { 
    return(this.emailCc);
  }

  public void setEmailCc(String emailCc) { 
    this.emailCc = emailCc;
  }

  public String getEmailBcc() { 
    return(this.emailBcc);
  }

  public void setEmailBcc(String emailBcc) { 
    this.emailBcc = emailBcc;
  }

  public String getEmailTo() { 
    return(this.emailTo);
  }

  public void setEmailTo(String emailTo) { 
    this.emailTo = emailTo;
  }

  public String getSentDate() { 
    return(this.sentDate);
  }

  public void setSentDate(String sentDate) { 
    this.sentDate = sentDate;
  }

  public String getAttchName() { 
    return(this.attchName);
  }

  public void setAttchName(String attchName) { 
    this.attchName = attchName;
  }

  public String getAttchSource() { 
    return(this.attchSource);
  }

  public void setAttchSource(String attchSource) { 
    this.attchSource = attchSource;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);

    this.setEmailType(null);
    this.setOperation(null);
    this.setUserid(null);
    this.setEmailSubject(null);
    this.setEmailFrom(null);
    this.setEmailCc(null);
    this.setEmailBcc(null);
    this.setEmailTo(null);
    this.setSentDate(null);
    this.setAttchName(null);
    this.setAttchSource(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsEmailAuditTrail tmpDmsEmailAuditTrail = new DmsEmailAuditTrail();
    tmpDmsEmailAuditTrail.setEmailType(this.getEmailType());
    tmpDmsEmailAuditTrail.setOperation(this.getOperation());
    tmpDmsEmailAuditTrail.setUserid(TextUtility.parseIntegerObj(this.getUserid()));
    tmpDmsEmailAuditTrail.setEmailSubject(this.getEmailSubject());
    tmpDmsEmailAuditTrail.setEmailFrom(this.getEmailFrom());
    tmpDmsEmailAuditTrail.setEmailCc(this.getEmailCc());
    tmpDmsEmailAuditTrail.setEmailBcc(this.getEmailBcc());
    tmpDmsEmailAuditTrail.setEmailTo(this.getEmailTo());
    tmpDmsEmailAuditTrail.setAttchName(this.getAttchName());
    tmpDmsEmailAuditTrail.setAttchSource(this.getAttchSource());
    tmpDmsEmailAuditTrail.setOperationSearchType(this.operationSearchType);
    tmpDmsEmailAuditTrail.setUserSearchType(this.userSearchType);
    tmpDmsEmailAuditTrail.setFromSearchType(this.fromSearchType);
    tmpDmsEmailAuditTrail.setToSearchType(this.toSearchType);
    tmpDmsEmailAuditTrail.setCcSearchType(this.ccSearchType);
    tmpDmsEmailAuditTrail.setBccSearchType(this.bccSearchType);
    tmpDmsEmailAuditTrail.setSentDateSearchType(this.sentDateSearchType);
    tmpDmsEmailAuditTrail.setSubjectSearchType(this.subjectSearchType);
    tmpDmsEmailAuditTrail.setAttchNameSearchType(this.attchNameSearchType);
    tmpDmsEmailAuditTrail.setTypeSearchType(this.typeSearchType);
    tmpDmsEmailAuditTrail.setSortAttribute(this.sortAttribute);
    tmpDmsEmailAuditTrail.setSortOrder(this.sortOrder);
    return tmpDmsEmailAuditTrail;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsEmailAuditTrail tmpDmsEmailAuditTrail = (DmsEmailAuditTrail)baseObj;
    this.setEmailType(tmpDmsEmailAuditTrail.getEmailType());
    this.setOperation(tmpDmsEmailAuditTrail.getOperation());
    this.setUserid(TextUtility.formatIntegerObj(tmpDmsEmailAuditTrail.getUserid()));
    this.setEmailSubject(tmpDmsEmailAuditTrail.getEmailSubject());
    this.setEmailFrom(tmpDmsEmailAuditTrail.getEmailFrom());
    this.setEmailCc(tmpDmsEmailAuditTrail.getEmailCc());
    this.setEmailBcc(tmpDmsEmailAuditTrail.getEmailBcc());
    this.setEmailTo(tmpDmsEmailAuditTrail.getEmailTo());
    this.setAttchName(tmpDmsEmailAuditTrail.getAttchName());
    this.setAttchSource(tmpDmsEmailAuditTrail.getAttchSource());
  }

	public List getResult() {
		return result;
	}

	public void setResult(List result) {
		this.result = result;
	}

	public String getAttchNameSearchType() {
		return attchNameSearchType;
	}

	public void setAttchNameSearchType(String attchNameSearchType) {
		this.attchNameSearchType = attchNameSearchType;
	}

	public String getBccSearchType() {
		return bccSearchType;
	}

	public void setBccSearchType(String bccSearchType) {
		this.bccSearchType = bccSearchType;
	}

	public String getCcSearchType() {
		return ccSearchType;
	}

	public void setCcSearchType(String ccSearchType) {
		this.ccSearchType = ccSearchType;
	}

	public String getFromSearchType() {
		return fromSearchType;
	}

	public void setFromSearchType(String fromSearchType) {
		this.fromSearchType = fromSearchType;
	}

	public String getOperationSearchType() {
		return operationSearchType;
	}

	public void setOperationSearchType(String operationSearchType) {
		this.operationSearchType = operationSearchType;
	}

	public String getSentDateSearchType() {
		return sentDateSearchType;
	}

	public void setSentDateSearchType(String sentDateSearchType) {
		this.sentDateSearchType = sentDateSearchType;
	}

	public String getSubjectSearchType() {
		return subjectSearchType;
	}

	public void setSubjectSearchType(String subjectSearchType) {
		this.subjectSearchType = subjectSearchType;
	}

	public String getToSearchType() {
		return toSearchType;
	}

	public void setToSearchType(String toSearchType) {
		this.toSearchType = toSearchType;
	}

	public String getTypeSearchType() {
		return typeSearchType;
	}

	public void setTypeSearchType(String typeSearchType) {
		this.typeSearchType = typeSearchType;
	}

	public String getUserSearchType() {
		return userSearchType;
	}

	public void setUserSearchType(String userSearchType) {
		this.userSearchType = userSearchType;
	}

	public String getSecondDate() {
		return secondDate;
	}

	public void setSecondDate(String secondDate) {
		this.secondDate = secondDate;
	}

	public String getSecondDateSearchType() {
		return secondDateSearchType;
	}

	public void setSecondDateSearchType(String secondDateSearchType) {
		this.secondDateSearchType = secondDateSearchType;
	}

	public String getSecondDateValue() {
		return secondDateValue;
	}

	public void setSecondDateValue(String secondDateValue) {
		this.secondDateValue = secondDateValue;
	}

	public String getSentDateValue() {
		return sentDateValue;
	}

	public void setSentDateValue(String sentDateValue) {
		this.sentDateValue = sentDateValue;
	}


	public String getSortAttribute() {
		return sortAttribute;
	}

	public void setSortAttribute(String sortAttribute) {
		this.sortAttribute = sortAttribute;
	}

	public String getSortOrder() {
		return sortOrder;
	}

	public void setSortOrder(String sortOrder) {
		this.sortOrder = sortOrder;
	}
}
